
from south.db import db
from django.db import models
from photologue.models import *

class Migration:
    
    def forwards(self, orm):
        
        # Adding model 'Watermark'
        db.create_table('photologue_watermark', (
            ('id', orm['photologue.Watermark:id']),
            ('name', orm['photologue.Watermark:name']),
            ('description', orm['photologue.Watermark:description']),
            ('image', orm['photologue.Watermark:image']),
            ('style', orm['photologue.Watermark:style']),
            ('opacity', orm['photologue.Watermark:opacity']),
        ))
        db.send_create_signal('photologue', ['Watermark'])
        
        # Adding model 'Gallery'
        db.create_table('photologue_gallery', (
            ('id', orm['photologue.Gallery:id']),
            ('date_added', orm['photologue.Gallery:date_added']),
            ('title', orm['photologue.Gallery:title']),
            ('title_slug', orm['photologue.Gallery:title_slug']),
            ('description', orm['photologue.Gallery:description']),
            ('is_public', orm['photologue.Gallery:is_public']),
            ('tags', orm['photologue.Gallery:tags']),
        ))
        db.send_create_signal('photologue', ['Gallery'])
        
        # Adding model 'GalleryUpload'
        db.create_table('photologue_galleryupload', (
            ('id', orm['photologue.GalleryUpload:id']),
            ('zip_file', orm['photologue.GalleryUpload:zip_file']),
            ('gallery', orm['photologue.GalleryUpload:gallery']),
            ('title', orm['photologue.GalleryUpload:title']),
            ('caption', orm['photologue.GalleryUpload:caption']),
            ('description', orm['photologue.GalleryUpload:description']),
            ('is_public', orm['photologue.GalleryUpload:is_public']),
            ('tags', orm['photologue.GalleryUpload:tags']),
        ))
        db.send_create_signal('photologue', ['GalleryUpload'])
        
        # Adding model 'PhotoSize'
        db.create_table('photologue_photosize', (
            ('id', orm['photologue.PhotoSize:id']),
            ('name', orm['photologue.PhotoSize:name']),
            ('width', orm['photologue.PhotoSize:width']),
            ('height', orm['photologue.PhotoSize:height']),
            ('quality', orm['photologue.PhotoSize:quality']),
            ('upscale', orm['photologue.PhotoSize:upscale']),
            ('crop', orm['photologue.PhotoSize:crop']),
            ('pre_cache', orm['photologue.PhotoSize:pre_cache']),
            ('increment_count', orm['photologue.PhotoSize:increment_count']),
            ('effect', orm['photologue.PhotoSize:effect']),
            ('watermark', orm['photologue.PhotoSize:watermark']),
        ))
        db.send_create_signal('photologue', ['PhotoSize'])
        
        # Adding model 'Photo'
        db.create_table('photologue_photo', (
            ('id', orm['photologue.Photo:id']),
            ('image', orm['photologue.Photo:image']),
            ('date_taken', orm['photologue.Photo:date_taken']),
            ('view_count', orm['photologue.Photo:view_count']),
            ('crop_from', orm['photologue.Photo:crop_from']),
            ('effect', orm['photologue.Photo:effect']),
            ('orientation', orm['photologue.Photo:orientation']),
            ('title', orm['photologue.Photo:title']),
            ('title_slug', orm['photologue.Photo:title_slug']),
            ('caption', orm['photologue.Photo:caption']),
            ('date_added', orm['photologue.Photo:date_added']),
            ('is_public', orm['photologue.Photo:is_public']),
            ('tags', orm['photologue.Photo:tags']),
        ))
        db.send_create_signal('photologue', ['Photo'])
        
        # Adding model 'PhotoEffect'
        db.create_table('photologue_photoeffect', (
            ('id', orm['photologue.PhotoEffect:id']),
            ('name', orm['photologue.PhotoEffect:name']),
            ('description', orm['photologue.PhotoEffect:description']),
            ('transpose_method', orm['photologue.PhotoEffect:transpose_method']),
            ('color', orm['photologue.PhotoEffect:color']),
            ('brightness', orm['photologue.PhotoEffect:brightness']),
            ('contrast', orm['photologue.PhotoEffect:contrast']),
            ('sharpness', orm['photologue.PhotoEffect:sharpness']),
            ('filters', orm['photologue.PhotoEffect:filters']),
            ('reflection_size', orm['photologue.PhotoEffect:reflection_size']),
            ('reflection_strength', orm['photologue.PhotoEffect:reflection_strength']),
            ('background_color', orm['photologue.PhotoEffect:background_color']),
        ))
        db.send_create_signal('photologue', ['PhotoEffect'])
        
        # Adding ManyToManyField 'Gallery.photos'
        db.create_table('photologue_gallery_photos', (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('gallery', models.ForeignKey(orm.Gallery, null=False)),
            ('photo', models.ForeignKey(orm.Photo, null=False))
        ))
        
    
    
    def backwards(self, orm):
        
        # Deleting model 'Watermark'
        db.delete_table('photologue_watermark')
        
        # Deleting model 'Gallery'
        db.delete_table('photologue_gallery')
        
        # Deleting model 'GalleryUpload'
        db.delete_table('photologue_galleryupload')
        
        # Deleting model 'PhotoSize'
        db.delete_table('photologue_photosize')
        
        # Deleting model 'Photo'
        db.delete_table('photologue_photo')
        
        # Deleting model 'PhotoEffect'
        db.delete_table('photologue_photoeffect')
        
        # Dropping ManyToManyField 'Gallery.photos'
        db.delete_table('photologue_gallery_photos')
        
    
    
    models = {
        'photologue.gallery': {
            'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
            'photos': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['photologue.Photo']", 'null': 'True', 'blank': 'True'}),
            'tags': ('TagField', [], {}),
            'title': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
            'title_slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'})
        },
        'photologue.galleryupload': {
            'caption': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'gallery': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['photologue.Gallery']", 'null': 'True', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
            'tags': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '75'}),
            'zip_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'})
        },
        'photologue.photo': {
            'caption': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'crop_from': ('django.db.models.fields.CharField', [], {'default': "'center'", 'max_length': '10', 'blank': 'True'}),
            'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'date_taken': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'effect': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'photo_related'", 'null': 'True', 'to': "orm['photologue.PhotoEffect']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}),
            'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
            'orientation': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
            'tags': ('TagField', [], {}),
            'title': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
            'title_slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'}),
            'view_count': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'})
        },
        'photologue.photoeffect': {
            'background_color': ('django.db.models.fields.CharField', [], {'default': "'#FFFFFF'", 'max_length': '7'}),
            'brightness': ('django.db.models.fields.FloatField', [], {'default': '1.0'}),
            'color': ('django.db.models.fields.FloatField', [], {'default': '1.0'}),
            'contrast': ('django.db.models.fields.FloatField', [], {'default': '1.0'}),
            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'filters': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}),
            'reflection_size': ('django.db.models.fields.FloatField', [], {'default': '0'}),
            'reflection_strength': ('django.db.models.fields.FloatField', [], {'default': '0.59999999999999998'}),
            'sharpness': ('django.db.models.fields.FloatField', [], {'default': '1.0'}),
            'transpose_method': ('django.db.models.fields.CharField', [], {'max_length': '15', 'blank': 'True'})
        },
        'photologue.photosize': {
            'crop': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
            'effect': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'photo_sizes'", 'null': 'True', 'to': "orm['photologue.PhotoEffect']"}),
            'height': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'increment_count': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
            'pre_cache': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
            'quality': ('django.db.models.fields.PositiveIntegerField', [], {'default': '70'}),
            'upscale': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
            'watermark': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'photo_sizes'", 'null': 'True', 'to': "orm['photologue.Watermark']"}),
            'width': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'})
        },
        'photologue.watermark': {
            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}),
            'opacity': ('django.db.models.fields.FloatField', [], {'default': '1'}),
            'style': ('django.db.models.fields.CharField', [], {'default': "'scale'", 'max_length': '5'})
        }
    }
    
    complete_apps = ['photologue']
